{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Automatic Table Display of Simple Data Structures\n",
    "\n",
    "BeakerX automatically displays Maps and Lists as Tables completely automatically in many circumstances."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "[\"x\" : 0, \"y\" : 1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "List list = new ArrayList();\n",
    "list.add([\"x\" : 2, \"y\" : 3]);\n",
    "list.add([\"x\" : 5, \"y\" : 8]);\n",
    "list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "Map[] map = new Map[2];\n",
    "map[0] = [\"x\" : 1.414, \"y\" : 2.718]\n",
    "map[1] = [\"x\" : 3.141, \"y\" : 4.669]\n",
    "map"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def listOfMap = []\n",
    "0.upto(10){\n",
    "    listOfMap += [\"exp2\": 2**it, \"exp3\": 3**it]\n",
    "}\n",
    "listOfMap"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def myMap = [:]\n",
    "def myList = []\n",
    "myList << [1, 2, 3]\n",
    "myList << [2, 3, 4]\n",
    "myMap.put(1, myList)\n",
    "myMap"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def myMap = [:]\n",
    "def myList = [width:1, height:2]\n",
    "myMap.put(1, myList)\n",
    "myMap"
   ]
  }
 ],
 "metadata": {
  "beakerx_kernel_parameters": {
   "classpath": [],
   "imports": []
  },
  "kernelspec": {
   "display_name": "Groovy",
   "language": "groovy",
   "name": "groovy"
  },
  "language_info": {
   "codemirror_mode": "groovy",
   "file_extension": ".groovy",
   "mimetype": "",
   "name": "Groovy",
   "nbconverter_exporter": "",
   "version": "2.4.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
